package com.xrkj.miniprogram.util;

import net.glxn.qrgen.core.image.ImageType;
import net.glxn.qrgen.javase.QRCode;
import org.springframework.util.Base64Utils;

import java.io.ByteArrayOutputStream;

public class QRUtil {
    public static String functiontest(String deviceCode){
        ByteArrayOutputStream data=new ByteArrayOutputStream();
        QRCode.from(deviceCode).withSize(200,200).to(ImageType.PNG).writeTo(data);
        byte[] bytedata= Base64Utils.encode(data.toByteArray());
        return new String(bytedata);

    }
}
